
<div id="account_center_baseinfo">
    <form class="baseinfo"  style="text-align: center; margin-top: 60px;">
        <div>
            <input name="nickname" type="text" placeholder="昵称" value="${session['user'].userInfo.getStr("nickname")}">
        </div>
        <div style="line-height: 32px; font-size: 16px;">
            <div style="background-color: #fff; margin-top: 10px; width: 256px; display: inline-block; border: 1px solid #bbb; padding-left: 10px; text-align: left;">
                <span style="display: inline-block; width: 60px;">性别</span>
                <#if session['user'].userInfo.getBoolean("gender")>
                    <span><input type="radio" checked="checked" name="gender" value="true">男</span>
                    <span style="display: inline-block; height: 20px; width: 28px;"></span>
                    <span><input type="radio" name="gender" value="false">女</span>
                <#else>
                    <span><input type="radio" name="gender" value="true">男</span>
                    <span style="display: inline-block; height: 20px; width: 28px;"></span>
                    <span><input type="radio" checked="checked" name="gender" value="false">女</span>
                </#if>
            </div>
        </div>
    </form>
    <div>
        <button  style="margin-left: 295px; width: 256px;" class="btn btn-default save">保存</button>
    </div>
</div>
<script>
    $(document).ready(function(){
        console.log($("#account_center_baseinfo .btn.save"));
        $("#account_center_baseinfo .btn.save").on("click", function(e){
            var formArr = $("form.baseinfo").serializeArray();
            var formJson = {};
            for(var index in formArr){
                formJson[formArr[index].name] = formArr[index].value;
            }
            console.log(formJson);
            $.post("/account/set_baseinfo", formJson, function(response){
                Pinion.simpleNotify({
                    message: "修改成功"
                })
            });
        });
    })
</script>